When data is encrypted and the encrypted data is stored in a database, the encrypted data may be arranged in an order entirely different from an order of the original data. This is because an encryption process converts original data into optional values, which causes the original data to be unpredictable. For this reason, when the data stored in the database is encrypted, a search, such as a range query, cannot be made without first decrypting the data.
As a method in the related art enabling a search such as a range query, there is an order-preserving encryption method. The order-preserving encryption method is a scheme which provides order information of original data elements to encrypted data elements. For example, a case is considered in which original data elements A, B, and C exist and are values different from each other in accordance with A<B<C. Also, in this case, when ciphertext of A encrypted by using the order-preserving encryption method is A′, ciphertext of B encrypted by using the order-preserving encryption method is B′, and ciphertext of C encrypted by using the order-preserving encryption method is C′, and A′, B′ and C′ have sizes expressed by A′<B′<C′, which is identical to the order according to the sizes of the original data elements.